** Model commands to replicate results in: 

	* Bartels, Brandon L., and Eric Kramon. 2025. "Can the Supreme Court Generate Public Acceptance of Election Rulings? Politicized
	* Appointments, Elite Norm Violations, and the 2020 Elections." Journal of Law and Courts (Forthcoming).


* Set working directory within which "replication_data.dta" is stored.
	cd "~/My Drive/Judicial Power Vertical Horizontal/Election 2020 Paper/Replication Archive JLC"

* Open analysis data
	use replication_data, clear

*Install mplotoffset program for graphing commands used in this replication file. 
	ssc install mplotoffset, replace

*****************************************
****** Reproduce results in paper *******
*****************************************

** Figure 1a
	regress accept_ruling_binary q2_cand2##i.round_ipsos##i.party3 [pw=wt_append]
	margins, at(round_ipsos=(1(1)4) q2_cand2=1 party3=(0 2))
	mplotoffset, offset(.1) legend(off) recast(scatter) recastci(rspike) ///
	ylab(.3 "30%" .4 "40%" .5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%" 1 "100%", notick grid gmin gmax glcolor(gs14) glstyle(line) glwidth(vthin) labsize(medsmall) angle(horizontal)) ///
	xlab(1 `" "After" "Barrett" "Nomination" "' 2 `" "After" "Barrett" "Confirmation" "' 3 `" "After" "Election" "Called for" "Biden" "' 4 `" "After" "Court" "Ruling" "', ///
	labsize(medsmall) nogrid tposition(inside) tlength(2.5)) xsca(range(0.75 4.25) lc(%0)) ysca(lc(%0)) ///
	graphregion(color(white))  ysize(3.5) xsize(3.5) ///
	plot1opts(msymbol(c) msize(medium) color(blue) lcolor(blue) lw(thin)) plot2opts(msymbol(S) msize(medium) color(red) lcolor(red) lw(thin)) ///
	ci1opts(color(blue) lwidth(vthin)) ci2opts(color(red) lwidth(vthin)) ///
	ytitle("") xtitle("") title("") xline(1.5 2.5 3.5, lw(vthin) lc(gs8) lp(line)) ///
	text(.87 1 "Rep.",  color(red) size(medsmall) justification(center)) ///
	text(.59 1 "Dem.", color(blue) size(medsmall) justification(center))

** Figure 1b
	regress accept_ruling_binary q2_cand2##i.round_ipsos##i.party3 [pw=wt_append]
	margins, at(round_ipsos=(1(1)4) q2_cand2=0 party3=(0 2))
	mplotoffset, offset(.1) legend(off) recast(scatter) recastci(rspike) ///
	ylab(.3 "30%" .4 "40%" .5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%" 1 "100%", notick grid gmin gmax glcolor(gs14) glstyle(line) glwidth(vthin) labsize(medsmall) angle(horizontal)) ///
	xlab(1 `" "After" "Barrett" "Nomination" "' 2 `" "After" "Barrett" "Confirmation" "' 3 `" "After" "Election" "Called for" "Biden" "' 4 `" "After" "Court" "Ruling" "', ///
	labsize(medsmall) nogrid tposition(inside) tlength(2.5)) xsca(range(0.75 4.25) lc(%0)) ysca(lc(%0)) ///
	graphregion(color(white))  ysize(3.5) xsize(3.5) ///
	plot1opts(msymbol(c) msize(medium) color(blue) lcolor(blue) lw(thin)) plot2opts(msymbol(S) msize(medium) color(red) lcolor(red) lw(thin)) ///
	ci1opts(color(blue) lwidth(vthin)) ci2opts(color(red) lwidth(vthin)) ///
	ytitle("") xtitle("") title("") xline(1.5 2.5 3.5, lw(vthin) lc(gs8) lp(line)) ///
	text(.93 1.32 "Rep.",  color(red) size(medsmall) justification(left)) ///
	text(.94 .7 "Dem.", color(blue) size(medsmall) justification(left))

* Figure 2
* To match four separate models approach - interact every variable with survey round dummy
	regress accept_ruling_binary i.q2_cand2##i.round_ipsos##i.party3 i.round_ipsos##i.race i.round_ipsos##c.age01 i.round_ipsos##c.educ01 i.round_ipsos##i.female ///
		i.round_ipsos##c.income01 if party3~=1, robust
	margins, dydx(q2_cand2) at(round_ipsos=(1(1)4) party3=(0 2)) 
	mplotoffset, offset(.1) recast(scatter) recastci(rspike) ytitle("Copartisan Candidate Effect") xtitle("") xsca(range(.75 4.25) lc(%0)) ysca(lc(%0)) ///
	graphregion(color(white))  ysize(4) xsize(4) legend(off) title("") ///
	ylab(-.6 "-60" -.5 "-50" -.4 "-40" -.3 "-30" -.2 "-20" -.1 "-10" 0 "0" .1 "10", ///
	notick grid gmin gmax glcolor(gs13) glstyle(line) glwidth(vthin) labsize(medsmall) angle(horizontal)) ///
	xlab(1 `" "After" "Barrett" "Nomination" "' 2 `" "After" "Barrett" "Confirmation" "' 3 `" "After" "Election" "Called for" "Biden" "' 4 `" "After" "Court" "Ruling" "', ///
	labsize(medsmall) nogrid tposition(inside) tlength(2.5)) ///
	plot1opts(msymbol(c) msize(medium) color(blue)  lw(thin)) plot2opts(msymbol(s) msize(medlarge) color(red) lw(thin))  ///
	ci1opts(color(blue) lwidth(vthin)) ci2opts(color(red) lwidth(vthin)) ///
	yline(0, lcolor(black) lw(medium)) xline(1.5 2.5 3.5, lw(vthin) lc(gs8) lpatt(line)) ///
	text(-.08 1 "Rep.",  color(red) size(medsmall) justification(center)) ///
	text(-.32 1 "Dem.", color(blue) size(medsmall) justification(center))

* Figure 2 (Alternative)
* Use four separate models, save results, and graph; generates the same results as above

	regress accept_ruling_binary i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==1 & party3~=1, robust
	margins, dydx(q2_cand2) at(party3=(0 2)) saving(r1, replace)

	regress accept_ruling_binary i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==2 & party3~=1, robust
	margins, dydx(q2_cand2) at(party3=(0 2)) saving(r2, replace)

	regress accept_ruling_binary i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==3 & party3~=1, robust
	margins, dydx(q2_cand2) at(party3=(0 2)) saving(r3, replace)

	regress accept_ruling_binary i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==4 & party3~=1, robust
	margins, dydx(q2_cand2) at(party3=(0 2)) saving(r4, replace)

	use r1
	gen round_ipsos=1
	save r1, replace

	use r2
	gen round_ipsos=2
	save r2, replace

	use r3
	gen round_ipsos=3
	save r3, replace

	use r4
	gen round_ipsos=4
	save r4, replace

	*Append all
	use r1, clear
	append using r2
	append using r3
	append using r4
	clonevar x=round_ipsos
	replace x = cond(_at2 ==0, x - 0.05, x + 0.05)
	save r_1_4, replace

	*Graphing command
	twoway (scatter _margin x if _at2==0, mcolor(blue) msymbol(O) msize(medium))  ///
	(scatter _margin x if _at2==2, mcolor(red) msymbol(S) msize(medium)) ///
	(rspike _ci_ub _ci_lb x if _at2==0, lc(blue) lw(thin)) ///
	(rspike _ci_ub _ci_lb x if _at2==2, lc(red) lw(thin)), ///
	ytitle("Copartisan Candidate Effect") xtitle("") xsca(r(.75 4.25) lc(%0)) ysca(lc(%0)) ///
	ysize(4) xsize(4) legend(off) title("") ///
	ylab(-.6 "-60" -.5 "-50" -.4 "-40" -.3 "-30" -.2 "-20" -.1 "-10" 0 "0" .1 "10", ///
	notick grid gmin gmax glcolor(gs13) glstyle(line) glwidth(vthin) labsize(medsmall) angle(horizontal)) ///
	xlab(1 `" "After" "Barrett" "Nomination" "' 2 `" "After" "Barrett" "Confirmation" "' 3 `" "After" "Election" "Called for" "Biden" "' 4 `" "After" "Court" "Ruling" "', ///
	labsize(medsmall) nogrid tposition(inside) tlength(2.5)) ///
	yline(0, lcolor(black) lw(medium)) xline(1.5 2.5 3.5, lw(vthin) lc(gs8) lpatt(line)) ///
	text(-.08 1 "Rep.",  color(red) size(medsmall) justification(center)) ///
	text(-.32 1 "Dem.", color(blue) size(medsmall) justification(center))

	
* Reload analysis data
	use replication_data, clear

*Figure 3
	reg election_decisions_binary i.round_i##i.party3 [pw=wt_append]
	margins, at(round_i=(5 6) party3=(0 2))
	mplotoffset,  legend(off) recast(scatter) recastci(rspike) ///
	xscale(range(4.3 6.7)) title("") ///
	xlabel(5 `" "After Biden" "Inauguration" "Jan. 22-29, 2021" "(Round 5)"' 6 `" "April 23 -" "May 2, 2021" "(Round 6)"', labsize(medium)  nogrid tposition(inside) tlength(2.5)) ///
	ylab(.3 "30%" .4 "40%" .5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%" 1 "100%", notick grid gmin gmax glcolor(gs12) glstyle(line) glwidth(vthin) labsize(medium) angle(horizontal)) ///
	graphregion(color(white))  ysize(3.5) xsize(3.5) ysca(lc(%0)) xsca(lc(%0)) ///
	plot1opts(msymbol(c) msize(medium) color(blue) lcolor(blue) lw(thin)) plot2opts(msymbol(S) msize(medium) color(red) lcolor(red) lw(thin)) ///
	ci1opts(color(blue) lwidth(vthin)) ci2opts(color(red) lwidth(vthin)) ///
	xtitle("") ytitle("") ///
	text( .62 5 "Dem.",  color(blue) size(medium) justification(center)) ///
	text( .86 5 "Rep.", color(red) size(medium) justification(center)) 	

	
* Commands for Contrasts (for commmunicating whether changes within and across survey rounds are statistically significant)
	regress accept_ruling_binary i.q2_cand2##i.round_ipsos##i.party3 i.round_ipsos##i.race i.round_ipsos##c.age01 i.round_ipsos##c.educ01 i.round_ipsos##i.female ///
		i.round_ipsos##c.income01 if party3~=1, robust
	* Dems
	* Post-Barrett
	margins, at(round_ipsos=(1 2) party3=0 q2_cand2=1) contrast(at(r))
	* Post-Election
	margins, at(round_ipsos=(2 3) party3=0 q2_cand2=1) contrast(at(r))
	*Post-SC Decision
	margins, at(round_ipsos=(3 4) party3=0 q2_cand2=1) contrast(at(r))

	* Reps
	* Post-Barrett
	margins, at(round_ipsos=(1 2) party3=2 q2_cand2=1) contrast(at(r))
	* Post-Election
	margins, at(round_ipsos=(2 3) party3=2 q2_cand2=1) contrast(at(r))
	*Post-SC Decision
	margins, at(round_ipsos=(3 4) party3=2 q2_cand2=1) contrast(at(r))

	** Contrasts between marginal effects between Republicans and Democrats at each time point
		*Pre Barrett
		margins, dydx(q2_cand2) at(round_ipsos=1 party3=(0 2)) contrast(at(r))
		*Post Barrett 
		margins, dydx(q2_cand2) at(round_ipsos=2 party3=(0 2)) contrast(at(r))
		*Post Election 
		margins, dydx(q2_cand2) at(round_ipsos=3 party3=(0 2)) contrast(at(r))
		*Post SC Decision
		margins, dydx(q2_cand2) at(round_ipsos=4 party3=(0 2)) contrast(at(r))
		
	** Contrasts between marginal effects between time periods for Republicans and Democrats
		*Dems
		*Post Barrett 
		margins, dydx(q2_cand2) at(round_ipsos=(1 2) party3=0) contrast(at(r))
		*Post Election 
		margins, dydx(q2_cand2) at(round_ipsos=(2 3) party3=0) contrast(at(r))
		*Post SC Decision
		margins, dydx(q2_cand2) at(round_ipsos=(3 4) party3=0) contrast(at(r))

		*Reps
		*Post Barrett 
		margins, dydx(q2_cand2) at(round_ipsos=(1 2) party3=2) contrast(at(r))
		*Post Election 
		margins, dydx(q2_cand2) at(round_ipsos=(2 3) party3=2) contrast(at(r))
		*Post SC Decision
		margins, dydx(q2_cand2) at(round_ipsos=(3 4) party3=2) contrast(at(r))
		
		
**********************************************************
****** Reproduce results in Supplementary Materials ******
**********************************************************

* Table B1
	*Binary Measure (columns 1-4)
	regress accept_ruling_binary i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==1 & party3~=1, robust
		
	regress accept_ruling_binary i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==2 & party3~=1, robust

	regress accept_ruling_binary i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==3 & party3~=1, robust
		
	regress accept_ruling_binary i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==4 & party3~=1, robust

	*Ordinal Measure (columns 5-8)		
	regress accept_ruling i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==1 & party3~=1, robust
		
	regress accept_ruling i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==2 & party3~=1, robust

	regress accept_ruling i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==3 & party3~=1, robust
		
	regress accept_ruling i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==4 & party3~=1, robust

* Figure B1A
	regress accept_ruling q2_cand2##i.round_ipsos##i.party3 [pw=wt_append]
	margins, at(round_ipsos=(1(1)4) q2_cand2=1 party3=(0 2))
	mplotoffset, offset(.1) legend(off) recast(scatter) recastci(rspike) ///
	ylab(.3(.1)1, notick grid gmin gmax glcolor(gs14) glstyle(line) glwidth(vthin) labsize(medsmall) angle(horizontal)) ///
	xlab(1 `" "After" "Barrett" "Nomination" "' 2 `" "After" "Barrett" "Confirmation" "' 3 `" "After" "Election" "Called for" "Biden" "' 4 `" "After" "Court" "Ruling" "', ///
	labsize(medsmall) nogrid tposition(inside) tlength(2.5)) xsca(range(0.75 4.25) lc(%0)) ysca(lc(%0)) ///
	graphregion(color(white))  ysize(3.5) xsize(3.5) ///
	plot1opts(msymbol(c) msize(medium) color(blue) lcolor(blue) lw(thin)) plot2opts(msymbol(S) msize(medium) color(red) lcolor(red) lw(thin)) ///
	ci1opts(color(blue) lwidth(vthin)) ci2opts(color(red) lwidth(vthin)) ///
	ytitle("") xtitle("") title("") xline(1.5 2.5 3.5, lw(vthin) lc(gs8) lp(line)) ///
	text(.72 1 "Rep.",  color(red) size(medsmall) justification(center)) ///
	text(.54 1 "Dem.", color(blue) size(medsmall) justification(center))

* Figure B1B
	regress accept_ruling q2_cand2##i.round_ipsos##i.party3 [pw=wt_append]
	margins, at(round_ipsos=(1(1)4) q2_cand2=0 party3=(0 2))
	mplotoffset, offset(.1) legend(off) recast(scatter) recastci(rspike) ///
	ylab(.3(.1)1, notick grid gmin gmax glcolor(gs14) glstyle(line) glwidth(vthin) labsize(medsmall) angle(horizontal)) ///
	xlab(1 `" "After" "Barrett" "Nomination" "' 2 `" "After" "Barrett" "Confirmation" "' 3 `" "After" "Election" "Called for" "Biden" "' 4 `" "After" "Court" "Ruling" "', ///
	labsize(medsmall) nogrid tposition(inside) tlength(2.5)) xsca(range(0.75 4.25) lc(%0)) ysca(lc(%0)) ///
	graphregion(color(white))  ysize(3.5) xsize(3.5) ///
	plot1opts(msymbol(c) msize(medium) color(blue) lcolor(blue) lw(thin)) plot2opts(msymbol(S) msize(medium) color(red) lcolor(red) lw(thin)) ///
	ci1opts(color(blue) lwidth(vthin)) ci2opts(color(red) lwidth(vthin)) ///
	ytitle("") xtitle("") title("") xline(1.5 2.5 3.5, lw(vthin) lc(gs8) lp(line)) ///
	text(.78 1.1 "Rep.",  color(red) size(medsmall) justification(left)) ///
	text(.93 1 "Dem.", color(blue) size(medsmall) justification(left))
		
* Figure B2 
* To match four separate models approach - interact every variable with survey round dummy
	regress accept_ruling i.q2_cand2##i.round_ipsos##i.party3 i.round_ipsos##i.race i.round_ipsos##c.age01 i.round_ipsos##c.educ01 i.round_ipsos##i.female ///
		i.round_ipsos##c.income01 if party3~=1, robust
	margins, dydx(q2_cand2) at(round_ipsos=(1(1)4) party3=(0 2)) 
	mplotoffset, offset(.1) recast(scatter) recastci(rspike) ytitle("Copartisan Candidate Effect") xtitle("") xsca(range(.75 4.25) lc(%0)) ysca(lc(%0)) ///
	graphregion(color(white))  ysize(4) xsize(4) legend(off) title("") ///
	ylab(-.6(.1).1, ///
	notick grid gmin gmax glcolor(gs13) glstyle(line) glwidth(vthin) labsize(medsmall) angle(horizontal)) ///
	xlab(1 `" "After" "Barrett" "Nomination" "' 2 `" "After" "Barrett" "Confirmation" "' 3 `" "After" "Election" "Called for" "Biden" "' 4 `" "After" "Court" "Ruling" "', ///
	labsize(medsmall) nogrid tposition(inside) tlength(2.5)) ///
	plot1opts(msymbol(c) msize(medium) color(blue)  lw(thin)) plot2opts(msymbol(s) msize(medlarge) color(red) lw(thin))  ///
	ci1opts(color(blue) lwidth(vthin)) ci2opts(color(red) lwidth(vthin)) ///
	yline(0, lcolor(black) lw(medium)) xline(1.5 2.5 3.5, lw(vthin) lc(gs8) lpatt(line)) ///
	text(-.08 1 "Rep.",  color(red) size(medsmall) justification(center)) ///
	text(-.35 1 "Dem.", color(blue) size(medsmall) justification(center))

* Figure B2 (alternative)	
* Use four separate models, save results, and graph; generates the same results as above
	regress accept_ruling i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==1 & party3~=1, robust
	margins, dydx(q2_cand2) at(party3=(0 2)) saving(r1_ord, replace)

	regress accept_ruling i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==2 & party3~=1, robust
	margins, dydx(q2_cand2) at(party3=(0 2)) saving(r2_ord, replace)

	regress accept_ruling i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==3 & party3~=1, robust
	margins, dydx(q2_cand2) at(party3=(0 2)) saving(r3_ord, replace)

	regress accept_ruling i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==4 & party3~=1, robust
	margins, dydx(q2_cand2) at(party3=(0 2)) saving(r4_ord, replace)

	use r1_ord
	gen round_ipsos=1
	save r1_ord, replace

	use r2_ord
	gen round_ipsos=2
	save r2_ord, replace

	use r3_ord
	gen round_ipsos=3
	save r3_ord, replace

	use r4_ord
	gen round_ipsos=4
	save r4_ord, replace

	*Append all
	use r1_ord, clear
	append using r2_ord
	append using r3_ord
	append using r4_ord
	clonevar x=round_ipsos
	replace x = cond(_at2 ==0, x - 0.05, x + 0.05)
	save r_1_4_ord, replace

	*Graphing command
	twoway (scatter _margin x if _at2==0, mcolor(blue) msymbol(O) msize(medium))  ///
	(scatter _margin x if _at2==2, mcolor(red) msymbol(S) msize(medium)) ///
	(rspike _ci_ub _ci_lb x if _at2==0, lc(blue) lw(thin)) ///
	(rspike _ci_ub _ci_lb x if _at2==2, lc(red) lw(thin)), ///
	ytitle("Copartisan Candidate Effect") xtitle("") xsca(r(.75 4.25) lc(%0)) ysca(lc(%0)) ///
	ysize(4) xsize(4) legend(off) title("") ///
	ylab(-.6(.1).1, notick grid gmin gmax glcolor(gs13) glstyle(line) glwidth(vthin) labsize(medsmall) angle(horizontal)) ///
	xlab(1 `" "After" "Barrett" "Nomination" "' 2 `" "After" "Barrett" "Confirmation" "' 3 `" "After" "Election" "Called for" "Biden" "' 4 `" "After" "Court" "Ruling" "', ///
	labsize(medsmall) nogrid tposition(inside) tlength(2.5)) ///
	yline(0, lcolor(black) lw(medium)) xline(1.5 2.5 3.5, lw(vthin) lc(gs8) lpatt(line)) ///
	text(-.08 1 "Rep.",  color(red) size(medsmall) justification(center)) ///
	text(-.35 1 "Dem.", color(blue) size(medsmall) justification(center))

* Reload analysis data
	use replication_data, clear

* Figure C1A
	regress accept_ruling_binary q2_cand2##i.round_ipsos##i.party3 if party7~=3 & party7~=5 [pw=wt_append]
	margins, at(round_ipsos=(1(1)4) q2_cand2=1 party3=(0 2))
	mplotoffset, offset(.1) legend(off) recast(scatter) recastci(rspike) ///
	ylab(.3 "30%" .4 "40%" .5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%" 1 "100%", notick grid gmin gmax glcolor(gs14) glstyle(line) glwidth(vthin) labsize(medsmall) angle(horizontal)) ///
	xlab(1 `" "After" "Barrett" "Nomination" "' 2 `" "After" "Barrett" "Confirmation" "' 3 `" "After" "Election" "Called for" "Biden" "' 4 `" "After" "Court" "Ruling" "', ///
	labsize(medsmall) nogrid tposition(inside) tlength(2.5)) xsca(range(0.75 4.25) lc(%0)) ysca(lc(%0)) ///
	graphregion(color(white))  ysize(3.5) xsize(3.5) ///
	plot1opts(msymbol(c) msize(medium) color(blue) lcolor(blue) lw(thin)) plot2opts(msymbol(S) msize(medium) color(red) lcolor(red) lw(thin)) ///
	ci1opts(color(blue) lwidth(vthin)) ci2opts(color(red) lwidth(vthin)) ///
	ytitle("") xtitle("") title("") xline(1.5 2.5 3.5, lw(vthin) lc(gs8) lp(line)) ///
	text(.87 1 "Rep.",  color(red) size(medsmall) justification(center)) ///
	text(.59 1 "Dem.", color(blue) size(medsmall) justification(center))

* Figure C1B
	regress accept_ruling_binary q2_cand2##i.round_ipsos##i.party3 if party7~=3 & party7~=5 [pw=wt_append]
	margins, at(round_ipsos=(1(1)4) q2_cand2=0 party3=(0 2))
	mplotoffset, offset(.1) legend(off) recast(scatter) recastci(rspike) ///
	ylab(.3 "30%" .4 "40%" .5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%" 1 "100%", notick grid gmin gmax glcolor(gs14) glstyle(line) glwidth(vthin) labsize(medsmall) angle(horizontal)) ///
	xlab(1 `" "After" "Barrett" "Nomination" "' 2 `" "After" "Barrett" "Confirmation" "' 3 `" "After" "Election" "Called for" "Biden" "' 4 `" "After" "Court" "Ruling" "', ///
	labsize(medsmall) nogrid tposition(inside) tlength(2.5)) xsca(range(0.75 4.25) lc(%0)) ysca(lc(%0)) ///
	graphregion(color(white))  ysize(3.5) xsize(3.5) ///
	plot1opts(msymbol(c) msize(medium) color(blue) lcolor(blue) lw(thin)) plot2opts(msymbol(S) msize(medium) color(red) lcolor(red) lw(thin)) ///
	ci1opts(color(blue) lwidth(vthin)) ci2opts(color(red) lwidth(vthin)) ///
	ytitle("") xtitle("") title("") xline(1.5 2.5 3.5, lw(vthin) lc(gs8) lp(line)) ///
	text(.93 1.32 "Rep.",  color(red) size(medsmall) justification(left)) ///
	text(.94 .7 "Dem.", color(blue) size(medsmall) justification(left))

* Figure C2
	regress accept_ruling_binary i.q2_cand2##i.round_ipsos##i.party3 i.round_ipsos##i.race i.round_ipsos##c.age01 i.round_ipsos##c.educ01 i.round_ipsos##i.female ///
		i.round_ipsos##c.income01 if party3~=1 & party7~=3 & party7~=5, robust
	margins, dydx(q2_cand2) at(round_ipsos=(1(1)4) party3=(0 2)) 
	mplotoffset, offset(.1) recast(scatter) recastci(rspike) ytitle("Copartisan Candidate Effect") xtitle("") xsca(range(.75 4.25) lc(%0)) ysca(lc(%0)) ///
	graphregion(color(white))  ysize(4) xsize(4) legend(off) title("") ///
	ylab(-.6 "-60" -.5 "-50" -.4 "-40" -.3 "-30" -.2 "-20" -.1 "-10" 0 "0" .1 "10", notick grid gmin gmax glcolor(gs13) glstyle(line) glwidth(vthin) labsize(medsmall) angle(horizontal)) ///
	xlab(1 `" "After" "Barrett" "Nomination" "' 2 `" "After" "Barrett" "Confirmation" "' 3 `" "After" "Election" "Called for" "Biden" "' 4 `" "After" "Court" "Ruling" "', ///
	labsize(medsmall) nogrid tposition(inside) tlength(2.5)) ///
	plot1opts(msymbol(c) msize(medium) color(blue)  lw(thin)) plot2opts(msymbol(s) msize(medlarge) color(red) lw(thin))  ///
	ci1opts(color(blue) lwidth(vthin)) ci2opts(color(red) lwidth(vthin)) ///
	yline(0, lcolor(black) lw(medium)) xline(1.5 2.5 3.5, lw(vthin) lc(gs8) lpatt(line)) ///
	text(-.08 1 "Rep.",  color(red) size(medsmall) justification(center)) ///
	text(-.35 1 "Dem.", color(blue) size(medsmall) justification(center))

* Figure C3
	reg election_decisions_binary i.round_i##i.party3 if party7~=3 & party7~=5 [pw=wt_append]
	margins, at(round_i=(5 6) party3=(0 2))
	mplotoffset,  legend(off) recast(scatter) recastci(rspike) ///
	xscale(range(4.3 6.7)) title("") ///
	xlabel(5 `" "After Biden" "Inauguration" "Jan. 22-29, 2021" "(Round 5)"' 6 `" "April 23 -" "May 2, 2021" "(Round 6)"', labsize(medium)  nogrid tposition(inside) tlength(2.5)) ///
	ylab(.3 "30%" .4 "40%" .5 "50%" .6 "60%" .7 "70%" .8 "80%" .9 "90%" 1 "100%", notick grid gmin gmax glcolor(gs12) glstyle(line) glwidth(vthin) labsize(medium) angle(horizontal)) ///
	graphregion(color(white))  ysize(3.5) xsize(3.5) ysca(lc(%0)) xsca(lc(%0)) ///
	plot1opts(msymbol(c) msize(medium) color(blue) lcolor(blue) lw(thin)) plot2opts(msymbol(S) msize(medium) color(red) lcolor(red) lw(thin)) ///
	ci1opts(color(blue) lwidth(vthin)) ci2opts(color(red) lwidth(vthin)) ///
	xtitle("") ytitle("") ///
	text( .58 5 "Dem.",  color(blue) size(medium) justification(center)) ///
	text( .86 5 "Rep.", color(red) size(medium) justification(center)) 	

* Table D1 
	logit accept_ruling_binary i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==1 & party3~=1
		
	logit accept_ruling_binary i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==2 & party3~=1

	logit accept_ruling_binary i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==3 & party3~=1
		
	logit accept_ruling_binary i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==4 & party3~=1


* Figure D1
* Four separate models, save results, graph 
	logit accept_ruling_binary i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==1 & party3~=1, robust
	margins, dydx(q2_cand2) at(party3=(0 2)) saving(r1_logit, replace)

	logit accept_ruling_binary i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==2 & party3~=1, robust
	margins, dydx(q2_cand2) at(party3=(0 2)) saving(r2_logit, replace)

	logit accept_ruling_binary i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==3 & party3~=1, robust
	margins, dydx(q2_cand2) at(party3=(0 2)) saving(r3_logit, replace)

	logit accept_ruling_binary i.q2_cand2##i.party3 black hisp otherrace age01 educ01 female income01 if round_ipsos==4 & party3~=1, robust
	margins, dydx(q2_cand2) at(party3=(0 2)) saving(r4_logit, replace)

	use r1_logit
	gen round_ipsos=1
	save r1_logit, replace

	use r2_logit
	gen round_ipsos=2
	save r2_logit, replace

	use r3_logit
	gen round_ipsos=3
	save r3_logit, replace

	use r4_logit
	gen round_ipsos=4
	save r4_logit, replace

	*Append all
	use r1_logit, clear
	append using r2_logit
	append using r3_logit
	append using r4_logit
	clonevar x=round_ipsos
	replace x = cond(_at2 ==0, x - 0.05, x + 0.05)
	save r_1_4_logit, replace

	*Graphing command
	twoway (scatter _margin x if _at2==0, mcolor(blue) msymbol(O) msize(medium))  ///
	(scatter _margin x if _at2==2, mcolor(red) msymbol(S) msize(medium)) ///
	(rspike _ci_ub _ci_lb x if _at2==0, lc(blue) lw(thin)) ///
	(rspike _ci_ub _ci_lb x if _at2==2, lc(red) lw(thin)), ///
	ytitle("Copartisan Candidate Effect") xtitle("") xsca(r(.75 4.25) lc(%0)) ysca(lc(%0)) ///
	ysize(4) xsize(4) legend(off) title("") ///
	ylab(-.6(.1).1, notick grid gmin gmax glcolor(gs13) glstyle(line) glwidth(vthin) labsize(medsmall) angle(horizontal)) ///
	xlab(1 `" "After" "Barrett" "Nomination" "' 2 `" "After" "Barrett" "Confirmation" "' 3 `" "After" "Election" "Called for" "Biden" "' 4 `" "After" "Court" "Ruling" "', ///
	labsize(medsmall) nogrid tposition(inside) tlength(2.5)) ///
	yline(0, lcolor(black) lw(medium)) xline(1.5 2.5 3.5, lw(vthin) lc(gs8) lpatt(line)) ///
	text(-.08 1 "Rep.",  color(red) size(medsmall) justification(center)) ///
	text(-.32 1 "Dem.", color(blue) size(medsmall) justification(center))
